package com.youthburin.rmp.domain;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;


/**
 * The persistent class for the rmp_permission database table.
 * 
 */
@Entity
@Table(name="rmp_permission")
public class RmpPermission extends BaseVO implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="CODE")
	private String code;

	@Column(name="NAME")
	private String name;

	@Column(name="REMARK")
	private String remark;

	//bi-directional many-to-one association to RmpPermissionType
    @ManyToOne
	@JoinColumn(name="TYPE_CODE")
	private RmpPermissionType rmpPermissionType;

	//bi-directional many-to-many association to RmpRole
    @ManyToMany
	@JoinTable(
		name="rmp_role_permission"
		, joinColumns={
			@JoinColumn(name="PERMISSION_CODE")
			}
		, inverseJoinColumns={
			@JoinColumn(name="ROLE_CODE")
			}
		)
	private Set<RmpRole> rmpRoles;

    public RmpPermission() {
    }

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public RmpPermissionType getRmpPermissionType() {
		return this.rmpPermissionType;
	}

	public void setRmpPermissionType(RmpPermissionType rmpPermissionType) {
		this.rmpPermissionType = rmpPermissionType;
	}
	
	public Set<RmpRole> getRmpRoles() {
		return this.rmpRoles;
	}

	public void setRmpRoles(Set<RmpRole> rmpRoles) {
		this.rmpRoles = rmpRoles;
	}
	
}